<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <f:view>
        <h:head>
            <link href="styles.css" rel="stylesheet" type="text/css"/>
            <title>
                <h:outputText value="#{messages.listarCliente}"/>
            </title>
        </h:head>
        <h:body>
            <h:form>
                <h:outputLabel value="Cliente Alterado Com Sucesso" style="color: blue; alignment-adjust: central;"/><br/>
                <h:messages />
                <h:dataTable id="tabela" border="1" value="#{clienteController.listaCliente}" var="clt">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{messages.idCliente}"/>
                        </f:facet>
                        <h:outputText value="#{clt.id}" />
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{messages.name}"/>
                        </f:facet>
                        <h:outputText value="#{clt.nome}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{messages.cpf}"/>
                        </f:facet>
                        <h:outputText value="#{clt.cpf}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{messages.rgCliente}"/>
                        </f:facet>
                        <h:outputText value="#{clt.rg}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{messages.telefoneCliente}"/>
                        </f:facet>
                        <h:outputText value="#{clt.telefone}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{messages.clienteFuncionario}"/>
                        </f:facet>
                        <h:outputText value="#{clt.funcionario.nome}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{messages.excluir}"/>
                        </f:facet>
                        <h:commandLink value="Excluir" action="#{clienteController.excluir}">
                            <f:setPropertyActionListener value="#{clt}" target="#{clienteController.cliente}" />
                        </h:commandLink>
                    </h:column>
                </h:dataTable>
                <h:commandButton value="Pagina Inicial"  action="paginaInicial">
                </h:commandButton>
            </h:form>
        </h:body>
    </f:view>
</html>

